package com.nancy.java_design.decorator.demo1;

/**
 * 具体装饰类：肉丝
 */
public class Meatdecorator extends Decorator{

    public Meatdecorator(FastFood fastFood) {
        // 调用父类的构造方法，传入价格和描述信息
        super(5,"肉丝",fastFood);
    }

    @Override
    public float cost() {
        // 返回装饰品的价格加上被装饰的食物的价格
        return getPrice() + getFastFood().getPrice();
    }
}
